package com.dzl.util;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

import com.dzl.config.exception.CommonException;

public class ReadPropertiesUtils {

	/**
	 * @Description:根据绝对路径读取properties文件
	 * @param fileName
	 * @return
	 * Properties
	 * @exception:
	 * @author: liufan
	 * @time:2021年1月16日 上午8:49:05
	 */
	public static Properties readPropertiesByFileName(String fileName) {
		Properties p;
		try {
			InputStream in = new BufferedInputStream(new FileInputStream(fileName));
			p = new Properties();
			p.load(in);
		} catch (Exception e) {
			throw new CommonException("支付秘钥获取错误");
		}
		return p;
	}
}
